<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<title>v-on</title>
	<script src="js/vue.js"></script>
</head>
<body>
		
<div id="app">
	<button v-on:click="fn()">点击1</button>
	<!-- 如果不需要传参，可以省略括号 -->
	<button v-on:click="fn">点击2</button>
	<!-- 缩写，简写 -->
	<button @click="fn">点击3</button>
	<!-- 带参数的 -->
	<button @click="hello('8866')">点击4</button>
	<p>{{ msg }}</p>
</div>

</body>
<script>
let vm = new Vue({
	el:'#app',
	data: {
		msg: "Hello"
	},
	methods:{
		fn(){
			this.msg = "欢迎来到HTML中文网。";
		},
		hello(par){
			this.msg = "参数值为：" + par;
		}
	}
})
</script>
</html>
